package cn.yitun.chat.yitunserverimbase.dao.system;

import cn.yitun.chat.yitunservercommonlib.crud.base.BootDao;
import cn.yitun.chat.yitunservercommonlib.dataentity.po.system.UserRoleInfo;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * 
 * @author chenyitun
 * @email chenyitun@163.com
 * @date 2020-05-27 14:45:10
 */
@Mapper
public interface UserRoleDao extends BootDao<UserRoleInfo> {
	/**
	 * 批量保存
	 * @param list
	 * @return
	 */
	int batchSave(@Param("list") List<UserRoleInfo> list);

	/**
	 * 多用户获取角色关联，去重
	 * @param userIdList
	 * @return
	 */
	List<UserRoleInfo> getListByUserIdList(@Param("userIdList") List<Long> userIdList);

	/**
	 * 删除用户角色信息
	 * @param userId
	 */
	int deleteByUserId(@Param("userId") Long userId);

	/**
	 * 删除角色关联
	 * @param roleId
	 */
	int deleteByRoleId(@Param("roleId") Long roleId);
}
